{include file="public/head"/} 
  <body>
    <div class="x-nav">
      <span class="layui-breadcrumb">
        <a><cite>后台管理</cite></a>
        <a><cite>停车场地管理中心</cite></a>
        <a><cite>停车账单管理</cite></a>
      </span>
      <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon" style="line-height:30px">ဂ</i></a>
    </div>
    <div class="x-body">
      <div class="layui-row">
        <form class="layui-form layui-col-md12 x-so"  method="get" action="{url(admin/index/orderinfo)}">
          <div class="layui-input-inline">
            <select name="out_parking_id" lay-filter="out_parking_id" id="out_parking_id" >
              <option value="">所属停车场</option>
              {foreach $parkinglist as $parking}
              <option value="{$parking.out_parking_id}" {if isset($out_parking_id)}{if $out_parking_id == $parking.out_parking_id} selected {/if}{/if}>{$parking.parking_name}</option>
              {/foreach}
            </select>
          </div>
         
          <div class="layui-input-inline">
            <select name="system" lay-filter="system" id="system">
              <option value="">所属岗亭</option>
              {if isset($systemout)}
              {foreach $systemout as $value}
                <option value="{$value['system']}" {if isset($system)}{if $system == $value['system']}selected{/if}{/if}>{$value['system_name']}</option>
              {/foreach}
              {/if}
            </select>
          </div>         
         
		  <input type="text" class="layui-input" id="test5" name="start_time" placeholder="开始时间" {if isset($start_time)}value="{$start_time}"{/if}>
          <input type="text" class="layui-input" id="test6" name="end_time" placeholder="结束时间" {if isset($end_time)}value="{$end_time}"{/if}>
          <button class="layui-btn"  lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
          <!-- <button type="reset" class="layui-btn"><i class="layui-icon">&#xe639;</i></button> -->
        </form>
      </div>
      <xblock style="font-size:14px;"> 
		支付宝代扣:<input type="text" class="layui-input" style="width:6%;display:inline-block;border-radius:5px;background:#0099CC;color:white" readonly value="{$money.apimoney}"/> &nbsp;&nbsp;&nbsp;
		支付宝扫码:<input type="text" class="layui-input" style="width:6%;display:inline-block;border-radius:5px;border-radius:5px;background:#9933CC;color:white" readonly value="{$money.ewmmoney}"/> &nbsp;&nbsp;&nbsp;
		微信:<input type="text" class="layui-input" style="width:6%;display:inline-block;border-radius:5px;background:#33CC66;color:white" readonly value="{$money.wxmoney}"/>  &nbsp;&nbsp;
		现金:<input type="text" class="layui-input" style="width:6%;display:inline-block;border-radius:5px;background:#FF0066;color:white" readonly value="{$money.cash}"/>  &nbsp;&nbsp;&nbsp;
		刷码:<input type="text" class="layui-input" style="width:6%;display:inline-block;border-radius:5px;background:#FF0066;color:white" readonly value="{$money.codeMoney}"/>  &nbsp;&nbsp;&nbsp;
		优惠券:<input type="text" class="layui-input" style="width:6%;display:inline-block;border-radius:5px;background:#CC99FF;color:white" readonly value="{$money.discount}"/>  &nbsp;&nbsp;&nbsp;
		
		储值车:<input type="text" class="layui-input" style="width:6%;display:inline-block;border-radius:5px;background:#0099CC;color:white" readonly value="{$money.carvalueMoney}"/>&nbsp;&nbsp;&nbsp;
        免费放行:<input type="text" class="layui-input" style="width:6%;display:inline-block;border-radius:5px;background:#CC99FF;color:white" readonly value="{$money.freeMoney}"/>  
		<span class="x-right" style="line-height:40px">共有数据：{$number} 条</span>
      </xblock>
      <table class="layui-table">
        <thead>
          <tr>
            <!-- <th style="text-align: center; font-size: 16px;">
              <div class="layui-unselect header layui-form-checkbox" lay-skin="primary"><i class="layui-icon">&#xe605;</i></div>
            </th>
            <th style="text-align: center; font-size: 16px; height: 30px;">用户支付宝ID</th>
            <th style="text-align: center; font-size: 16px;">ISV停车场ID</th> -->
            <!-- <th style="text-align: center; font-size: 16px;">区域名称</th> -->
            <th style="text-align: center; font-size: 16px;">停车场名称</th>
            <!--<th style="text-align: center; font-size: 16px;">支付宝停车场ID</th>-->
            <th style="text-align: center; font-size: 16px;">车牌号码</th>
            <!--<th style="text-align: center; font-size: 16px;">系统订单号</th>-->
            <th style="text-align: center; font-size: 16px;">订单状态</th>
            <!--<th style="text-align: center; font-size: 16px;">订单创建时间</th>
            <th style="text-align: center; font-size: 16px;">支付宝订单号</th>-->
            <th style="text-align: center; font-size: 16px;">缴费时间</th>
            <th style="text-align: center; font-size: 16px;">付款方式</th>
            <th style="text-align: center; font-size: 16px;">应收费用</th>
			<th style="text-align: center; font-size: 16px;">实收金额</th>
			<th style="text-align: center; font-size: 16px;">优惠金额</th>
            <th style="text-align: center; font-size: 16px;">入场时间</th>
            <th style="text-align: center; font-size: 16px;">出场时间</th>
            <th style="text-align: center; font-size: 16px;">停车时长</th>
			{if $usertype == 0}
            <th style="text-align: center; font-size: 16px;">操作</th>
            {/if}
            <!-- <th style="text-align: center; font-size: 16px;">状态</th> -->
          </tr>
        </thead>
        <tbody>
          {foreach $list as $lis}
          <tr>
            <!-- <td style="text-align: center;">
              <div class="layui-unselect layui-form-checkbox" lay-skin="primary" data-id='2'><i class="layui-icon">&#xe605;</i></div>
            </td>
            <td style="text-align: center;">{$lis.user_id}</td>
            <td style="text-align: center;">{$lis.out_parking_id}</td> -->
            <td style="text-align: center;">{$lis.parking_name}</td>
            <!--<td style="text-align: center;">{$lis.parking_id}</td>-->
            <td style="text-align: center;">{$lis.car_number}</td>
            <!--<td style="text-align: center;">{$lis.out_order_no}</td>-->
            <td style="text-align: center;">
              {if $lis.order_status == 'TRADE_SUCCESS'}
                已付款
              {elseif $lis.order_status == 0}
                停车中
              {/if}
            </td>
            <!--<td style="text-align: center;">{$lis.order_time}</td>
            <td style="text-align: center;">{$lis.order_no}</td>-->
            <td style="text-align: center;">{$lis.pay_time|date="Y-m-d H:i:s",###}</td>
            <td style="text-align: center;">
				{if $lis.pay_type=="1"}支付宝代扣{/if}
				{if $lis.pay_type=="2"}支付宝扫码{/if}
				{if $lis.pay_type=="3"}支付宝预交费{/if}
				{if $lis.pay_type=="4"}微信代扣{/if}
				{if $lis.pay_type=="5"}微信预交费{/if}
				{if $lis.pay_type=="6"}微信扫码{/if}
				{if $lis.pay_type=="7"}现金{/if}
				{if $lis.pay_type=="8"}固定优惠券{/if}
				{if $lis.pay_type=="9"}停车优惠券{/if}
				{if $lis.pay_type=="10"}优惠券{/if}
				{if $lis.pay_type=="11"}刷码支付{/if}
				{if $lis.pay_type=="12"}0费用{/if}
				{if $lis.pay_type=="13"}业主福利车{/if}
				{if $lis.pay_type=="14"}免费放行{/if}
				{if $lis.pay_type=="15"}储值车{/if}
			</td>
            <td style="text-align: center;">{$lis.pay_money}元</td>
			<td style="text-align: center;">{$lis.receipt_amount}元</td>
			<td style="text-align: center;">{$lis.discount_money}元</td>
            <td style="text-align: center;">{$lis.in_time|date="Y-m-d H:i:s",###}</td>
            <td style="text-align: center;">{$lis.out_time|date="Y-m-d H:i:s",###}</td>
            <td style="text-align: center;">
              
                {$lis.in_duration} 
              
			</td>
			{if $usertype == 0}
            <td class="td-manage" style="text-align: center;">
              <a title="删除" onclick="parkingDel('{$lis.id}', '{$lis.id}')" href="javascript:;" id="{$lis.id}">
                <i class="layui-icon">&#xe640;</i>
              </a>
            </td>
            {/if}
            
          </tr>
          {/foreach}
        </tbody>
      </table>
      <div class="page">
        <div>
            {$orderlist->render()}
        </div>
      </div>

    </div>
    <script>
		layui.use('laydate', function() {
            var laydate = layui.laydate;
            //日期时间选择器
            laydate.render({
                elem: '#test5'
                ,type: 'datetime'
            });
            //日期时间选择器
            laydate.render({
                elem: '#test6'
                ,type: 'datetime'
            });
        });
     
		layui.use(['form'], function() {
	     	form=layui.form;
			form.on('select(out_parking_id)', function(data){   
		  		var val=data.value;
				console.log(val);
				if(val==""){
					$('#system').html("<option value=''>所属岗亭</option>");
					form.render('select')
				}else{
					var url = "{:url('admin/index/getsystemout')}"
					$.post(url, {parking_id:val}, function(res) {
						console.log(res);
						$('#system').html(res);
						form.render('select')
					},'html')
				}
				
            });

        })
		
    </script>
    <script>var _hmt = _hmt || []; (function() {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
      })();
    </script>
  </body>

</html>